'''
Created on Jan 18, 2010

@author: christianp
'''

class TileRange(object):

    __first_col = 0
    __last_col = 0
    __first_row = 0
    __last_row = 0

    def __init__(self, first_col, first_row, last_col, last_row):
        self.__first_col = first_col
        self.__last_col = last_col
        self.__first_row = first_row
        self.__last_row = last_row
    
    def getFirstCol(self):
        return self.__first_col
    
    def setFirstCol(self, first_col):
        self.__first_col = first_col
    
    def getLastCol(self):
        return self.__last_col
    
    def setLastCol(self, last_col):
        self.__last_col = last_col
    
    def getFirstRow(self):
        return self.__first_row
    
    def setFirstRow(self, first_row):
        self.__first_row = first_row
    
    def getLastRow(self):
        return self.__last_row
    
    def setLastRow(self, last_row):
        self.__last_row = last_row
    
    def equals(self, tile_range):
        if (self.__first_col == tile_range.get_first_col()):
            if (self.__last_col == tile_range.get_last_col()):
                if (self.__first_row == tile_range.get_first_row()):
                    if (self.__last_row == tile_range.get_last_row()):
                        return True
        
        return False
    
    def _print(self, prefix):
        print(prefix + " first col = " + str(self.__first_col))
        print(prefix + " last col = " + str(self.__last_col))
        print(prefix + " first row = " + str(self.__first_row))
        print(prefix + " last row = " + str(self.__last_row))